#include "ObjectInputStream.h"

namespace Entities {

	ObjectInputStream::ObjectInputStream(istream & _in):in(_in){}

	istream & ObjectInputStream::getStream(){
		return in;
	}

	istream & operator>>(istream & is, ObjectInputStream & obj){
		return obj.in;
	}

	ObjectInputStream & ObjectInputStream::operator>>(Serializable & obj){
		//cout << "Lserializable" << endl;
		if ( !readObject(obj) ) throw ObjectStreamException("Erreur de lecture\n");
		return *this;
	}
}